#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

struct edge_str
{
    int posx, posy;
    //查找结构体e是否存在
    bool operator==(const edge_str &e)
    {
        return (this->posx == e.posx) && (this->posy == e.posy);
    }
    //查找数值pos是否与posx相等
    bool operator==(const int &pos)
    {
        return (this->posx == pos);
    }
};

int main()
{
    vector<edge_str> arr;
    // 1.查找结构体x是否存在与arr中
    vector<edge_str>::iterator it;
    edge_str x;
    x.posx = 5;
    x.posy = 7;
    arr.push_back(x);
    it = find(arr.begin(), arr.end(), x);
    if (it != arr.end())
    {
        cout << "Find!" << endl;
    }
    else
        cout << "Not find!" << endl;

    // 2 .查找数值pos是否存在与arr的posx中
    vector<edge_str>::iterator it2;
    int pos = 7;
    it2 = find(arr.begin(), arr.end(), pos);
    if (it2 != arr.end())
    {
        cout << "Find!" << endl;
    }
    else
        cout << "Not find!" << endl;
}
